using System;
using System.Configuration;
using System.Data;

namespace Jfc.DnnMarketingTools.MemberInvite
{
    /// -----------------------------------------------------------------------------
    ///<summary>
    /// The StatusType enum for the MemberInvite Status
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <history>
    /// </history>
    /// -----------------------------------------------------------------------------
    public enum StatusType
    {
        Registered = 0,
        Sent = 1,
        Canceled = 2,
        Bounced = 3,
        Accepted = 4
    }

    /// -----------------------------------------------------------------------------
    ///<summary>
    /// The Info class for the MemberInvite
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <history>
    /// </history>
    /// -----------------------------------------------------------------------------
    public class MemberInviteInfo
    {

    #region Private Members

        private int _InviteId;
        private int _PortalId;
        private Guid _InviteGuid;
        private string _FirstName;
        private string _LastName;
        private string _Email;
        private string _Subject;
        private string _Body;
        private int _CreatedByUser;
        private DateTime _CreatedDate;
        private StatusType _Status;
        private DateTime _StatusDate;

    #endregion

    #region Constructors

        // initialization
        public MemberInviteInfo()
        {
        }

    #endregion

    #region Public Properties

        /// <summary>
        /// Gets and sets the Invite Id
        /// </summary>
        public int InviteId
        {
            get
            {
                return _InviteId;
            }
            set
            {
                _InviteId = value;
            }
        }

        /// <summary>
        /// Gets and sets the Portal Id
        /// </summary>
        public int PortalId
        {
            get
            {
                return _PortalId;
            }
            set
            {
                _PortalId = value;
            }
        }

        /// <summary>
        /// Gets and sets the Invite Guid
        /// </summary>
        public Guid InviteGuid
        {
            get
            {
                return _InviteGuid;
            }
            set
            {
                _InviteGuid = value;
            }
        }

        public string FirstName
        {
            get { return _FirstName; }
            set { _FirstName = value; }
        }

        public string LastName
        {
            get { return _LastName; }
            set { _LastName = value; }
        }

        public string Email
        {
            get { return _Email; }
            set { _Email = value; }
        }

        public string Subject
        {
            get { return _Subject; }
            set { _Subject = value; }
        }

        /// <summary>
        /// gets and sets the Body
        /// </summary>
        public string Body
        {
            get
            {
                return _Body;
            }
            set
            {
                _Body = value;
            }
        }

        /// <summary>
        /// Gets and sets the User Id who Created/Updated the content
        /// </summary>
        public int CreatedByUser
        {
            get
            {
                return _CreatedByUser;
            }
            set
            {
                _CreatedByUser = value;
            }
        }

        /// <summary>
        /// Gets and sets the Date when Created/Updated
        /// </summary>
        public DateTime CreatedDate
        {
            get
            {
                return _CreatedDate;
            }
            set
            {
                _CreatedDate = value;
            }
        }

        public StatusType Status
        {
            get { return _Status; }
            set { _Status = value; }
        }

        public DateTime StatusDate
        {
            get { return _StatusDate; }
            set { _StatusDate = value; }
        }

    #endregion

        public void SetStatus(StatusType status)
        {
            if (_Status != status)
            {
                _Status = status;
                _StatusDate = DateTime.Now;
            }
        }
    }
}
